<!-- BEGIN header -->
<% if @collection %>
<!-- custom css for header -->
<style type="text/css">
#header  {  background:#7887AF url(<%= @collection.header_image_url || (@collection_parent ? @collection_parent.header_image_url : '') %>);}
</style>
<% end %>

<div id="header"<% if @collection %> class="collection"<% end %> role="banner">
  <% if @collection %>
    <h1 class="collection"><%= link_to ArchiveConfig.APP_NAME, root_path %> (BETA)</h1>
  <% end %>
  <div id="login-block">
  <% if logged_in? || logged_in_as_admin? %>
    <%= render :partial => 'user_sessions/greeting' %>
  <% else %>
    <ul id="greeting" class="logged-out">
      <li>
        <%= render :partial => 'user_sessions/login' %>
        <span><a id='signin_closed' onclick='toggleLogin("signin")' style='display:none;'><%=h t('.layout.header.sign_in', :default => 'Log in') %></a>
        <a id='signin_open' onclick='toggleLogin("signin")'><%=h t('.links.cancel', :default => 'Cancel') %></a></span>
      </li>
    </ul>
  <% end %>
  <%= render :partial => 'works/search_box' %>
</div>

<% if @collection %>
  <h1 class="collections"><%= @collection.title ? @collection.title : (@collection_parent ? @collection_parent.title : t('.layouts.new_collection', :default => "New Collection")) %></h1>
<% else %>
  <h1>
    <%= link_to ArchiveConfig.APP_NAME, root_path %> (BETA)
  </h1>
<% end %>

<h3 class="landmark">Site Navigation</h3>
  <ul class="navigation" role="navigation">
    <li><%= logged_in? ? span_if_current('my home', user_path(current_user)) : span_if_current('home', root_path) %></li>
    <li><%= span_if_current('fandoms', media_path) %></li>
    <li><%= span_if_current('works', works_path) %></li>
    <li><%= span_if_current('people', people_path) %></li>
    <li><%= span_if_current('bookmarks', bookmarks_path) %></li>
    <li><%= span_if_current('tags', tags_path) %></li>
    <li><%= span_if_current('collections', collections_path) %></li>
  </ul>

  <% if logged_in_as_admin? %>
    <%= render :partial => 'admin/header' %>
  <% end %>
  <div class="clear"></div>
</div>

<!-- END header -->

